﻿using System;
using Medianamik.Client.MVP.Model.Service;
using Medianamik.Core;
using Medianamik.Core.Caching;
using Medianamik.Core.DAL;
using Medianamik.Core.DAL.Repositories;
using Medianamik.Core.DAL.Services;
using StructureMap.Configuration.DSL;

namespace Medianamik.Client.MVP
{
    public class MedianamikRegistry : Registry
    {
        public MedianamikRegistry()
        {
            ForRequestedType<ICurrentNodeIdRetriever>()
                .TheDefaultIsConcreteType<CurrentNodeIdRetriever>();
            ForRequestedType(typeof (ICacheService<>))
                .TheDefaultIsConcreteType(typeof (CacheService<>));
            ForRequestedType<ICurrentNodeIdRetriever>()
                .TheDefaultIsConcreteType<CurrentNodeIdRetriever>();
            ForRequestedType<ICultureService>()
                .TheDefaultIsConcreteType<CultureService>();
            ForRequestedType<IContentStateService>()
                .TheDefaultIsConcreteType<ContentStateService>();
            ForRequestedType<INodeTypeRepository>()
                .TheDefaultIsConcreteType<NodeTypeRepository>();
            ForRequestedType<INodeMapper>()
               .TheDefaultIsConcreteType<NodeMapper>();

            AddBindings();
        }

        protected virtual void AddBindings()
        {
            
        }
    }
}
